package com.gexin.controller.xapp.acitivity;

import com.gexin.common.model.ApiResponse;
import com.gexin.core.interceptor.XAppSafeInterceptor;
import com.gexin.core.web.AppController;
import com.gexin.service.memberAcitivty.IntegralService;
import com.gexin.service.memberAcitivty.MemberInfoService;
import com.jfinal.aop.Before;
import com.jfinal.ext.route.ControllerBind;

@Before(XAppSafeInterceptor.class)//统一错误拦截
@ControllerBind(controllerKey = "/xapp/MemberInfoController")
public class MemberInfoController  extends AppController{

    private MemberInfoService memberInfoService = new MemberInfoService();

    private IntegralService integralService = new IntegralService();

    public void getMemberInfo(){
        String authUser = getAuthUserId()+"";
        ApiResponse memberInfo = memberInfoService.getMemberInfo(authUser);
        renderJson(memberInfo);
        return;
    }


    /**
     * 通知成为会员功能
     */
    public void checkTobeMember(){
        String authUser = getAuthUserId()+"";
        ApiResponse apiResponse = integralService.checkTobeMember(authUser);
        renderJson(apiResponse);
        return;
    }


}
